package com.edu.whty.dao;


import com.edu.whty.dao.base.IBaseDao;
import com.edu.whty.entity.cloud.CloudPageReq;
import com.edu.whty.entity.cloud.TbCourseRes;
import com.edu.whty.entity.cloud.TbCourseUser;

import java.util.List;
import java.util.Map;

public interface TbCourseResMapper extends IBaseDao<TbCourseRes> {
    public TbCourseRes getByResId(Map<String, Object> param);

    public List<TbCourseRes> getByPackageId(String packageId);

    public TbCourseRes getShareResByResId(String resId);

    public List<TbCourseRes> getByIds(List<String> resIds);

    public int getMyCourseResCount(CloudPageReq cloudPage);

    public List<TbCourseRes> getMyCourseResList(CloudPageReq cloudPage);

    List<TbCourseRes> initCourseResList(CloudPageReq cloudPage);

    void saveCourseResBatch(List<TbCourseRes> list);

    void updateCourseResBatch(List<TbCourseRes> list);

    int selectResExists(TbCourseRes tbCourseRes);

    /**
	 * 批量同步新增课程资源
	 * @param List
	 * @throws Exception
	 */
	void syncSaveCourseResBatch(List<Map<String, Object>> list);

	/**
	 * 批量同步更新课程资源
	 * @param List
	 * @throws Exception
	 */
	void syncUpdateCourseResBatch(List<Map<String, Object>> list);

	/**
	 * 批量同步课程资源
	 * @param List
	 * @throws Exception
	 */
	void syncSaveOrUpdateBatch(List<Map<String, Object>> list);

	/**
	 * 批量同步删除课程资源
	 * @param List
	 * @throws Exception
	 */
	void syncDeleteCourseResBatch(List<Map<String, Object>> list);

	/**
	 * 获取待上行同步的课程资源
	 * @throws Exception
	 */
	List<Map<String, Object>> getUpSyncCourseRes();

	/**
	 * 更新待同步课程资源为已同步
	 * @throws Exception
	 */
    void finishUpSyncCourseRes() throws Exception;

    void addViewCount(String resId);

    void addDownCount(String resId);

	void finishUpSyncCourseResByOrgId(String resId);

    void updateStatus(String sourceId);

	void updateUserRes(TbCourseRes courseRes);

    List<TbCourseRes> queryLyData(Map map);

    void deleteShangHaiRes(List<String> resIdList);
}
